package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.model.SpuPoster;
import com.atguigu.gmall.product.model.SpuSaleAttr;
import com.atguigu.gmall.product.mapper.SpuSaleAttrMapper;
import com.atguigu.gmall.product.service.SpuSaleAttrService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * spu销售属性 业务实现类
 *
 * @author muzhuo
 * @since 2023-07-25
 */
@Service
public class SpuSaleAttrServiceImpl extends ServiceImpl<SpuSaleAttrMapper, SpuSaleAttr> implements SpuSaleAttrService {

    @Override
    public List<SpuSaleAttr> getListByspuId(Long id) {

        LambdaQueryWrapper<SpuSaleAttr> queryWrapper = new LambdaQueryWrapper<SpuSaleAttr>();
        queryWrapper.eq(SpuSaleAttr::getSpuId, id);
        return this.list(queryWrapper);
    }

    @Override
    public void removeBySpuId(Long spuId) {
        this.baseMapper.deleteBySpuId(spuId);
    }

}
